package com.htl.exampro.exam.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 考试表
 * </p>
 *
 * @author hehehe
 * @since 2025-05-26
 */
@Data
@TableName("exam")
public class ExamDO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    public static final String EXAM_ID = "exam_id";
    public static final String EXAM_NAME = "exam_name";
    public static final String DESCRIPTION = "description";
    public static final String START_TIME = "start_time";
    public static final String END_TIME = "end_time";
    public static final String DURATION = "duration";
    public static final String TOTAL_SCORE = "total_score";
    public static final String PARENT_EXAM_ID = "parent_exam_id";
    public static final String CREATED_PERSON = "created_person";
    public static final String CREATED_TIME = "created_time";
    public static final String UPDATED_PERSON = "updated_person";
    public static final String UPDATED_TIME = "updated_time";
    public static final String IS_DELETED = "is_deleted";
    /**
     * 考试ID
     */
    @TableId(value = "exam_id", type = IdType.ASSIGN_ID)
    private Long examId;

    /**
     * 考试名称
     */
    @TableField("exam_name")
    private String examName;

    /**
     * 试卷ID
     */
    @TableField("paper_id")
    private Long paperId;

    /**
     * 考试说明（如：包含章节范围、题型分布等）
     */
    @TableField("description")
    private String description;

    /**
     * 考试开始时间
     */
    @TableField("start_time")
    private LocalDateTime startTime;

    /**
     * 考试结束时间
     */
    @TableField("end_time")
    private LocalDateTime endTime;

    /**
     * 考试时长(分钟)
     */
    @TableField("duration")
    private Integer duration;

    /**
     * 考试总分
     */
    @TableField("total_score")
    private Integer totalScore;

    /**
     * 父考试ID（用于创建多级考试结构）
     */
    @TableField("parent_exam_id")
    private Long parentExamId;

    /**
     * 创建人ID
     */
    @TableField(value = "created_person", fill = FieldFill.INSERT)
    private String createdPerson;

    /**
     * 创建时间
     */
    @TableField("created_time")
    private LocalDateTime createdTime;

    /**
     * 修改人ID
     */
    @TableField(value = "updated_person", fill = FieldFill.UPDATE)
    private String updatedPerson;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    private LocalDateTime updatedTime;

    /**
     * 逻辑删除标志 0-未删除 1-已删除
     */
    @TableLogic
    @TableField("is_deleted")
    private Boolean isDeleted;
}
